package org.demo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import net.minidev.json.annotate.JsonIgnore;

import java.time.LocalDate;
import java.util.Date;

@Data
public class Users {
    private String id;
    private String username;
    @JsonIgnore//对象转json字符串的时候，忽略这个对象
    private String password;
    private String roleId;
    @NotEmpty
    @Email
    private String email;
    private String phone;
    @NotEmpty
    @Pattern(regexp = "^\\S{1,10}$")
    private String nickname;
    private String userPic;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

}
